From b988e88cc041f630dcfa735dcf9c895310103629 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Mon, 27 Mar 2017 10:45:58 +0100 Subject: [PATCH] x86/emul: Add feature check for clzero Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- xen/arch/x86/x86_emulate/x86_emulate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 497cc77c65..7af8a4266d 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -1604,6 +1604,7 @@ static bool vcpu_has( #define vcpu_has_clwb() vcpu_has( 7, EBX, 24, ctxt, ops) #define vcpu_has_sha() vcpu_has( 7, EBX, 29, ctxt, ops) #define vcpu_has_rdpid() vcpu_has( 7, ECX, 22, ctxt, ops) +#define vcpu_has_clzero() vcpu_has(0x80000008, EBX, 0, ctxt, ops) #define vcpu_must_have(feat) \ generate_exception_if(!vcpu_has_##feat(), EXC_UD) @@ -5183,6 +5184,8 @@ x86_emulate( { unsigned long zero = 0; + vcpu_must_have(clzero); + base = ad_bytes == 8 ? _regs.r(ax) : ad_bytes == 4 ? _regs.eax : _regs.ax; limit = 0; -- 2.30.2